include io.asm

stack segment stack
	dw 128 dup (?)
stack ends

;;======================================================================
data segment
	Head db "Vasilenko Anatoly. Group 111.$"
	Input db "Enter please number: $"
	Output db "Degree(3) of this number: $"
data ends
;;======================================================================

code segment 'code'
	assume ss:stack, ds:data, cs:code
start:
	mov ax,data
	mov ds,ax
	lea dx, Head
	outstr
	newline
	newline
	;;------------------------------------------------------------------
		lea dx, Input;
		outstr;
		inint ax; read(n)
		
		mov bx, 0; K = 0
		mov cx, 3;
		
	L1: cmp ax, 1; 
		je answer;
		mov dx, 0;
		div cx;
		cmp dx, 0;
		jne answer0;
		inc bx;
		jmp L1;
		
	answer0:
		mov bx, -1;
	answer:
		lea dx, Output;
		outstr;
		outint bx;
		newline;
		
	;;------------------------------------------------------------------
	newline;
	mov ah,8
	int 21h
    finish
code ends

;;======================================================================
end start 

;;======================================================================
